﻿using System;
using System.Runtime.Serialization;

namespace memo
{
    /// <summary>
    /// Serves as an exception that will be thrown by the DataAccessor if any exception happens.
    /// </summary>
    public class MemoDataAccessorException : Exception
    {
        /// <summary>
        /// Constructor without any added information.
        /// </summary>
        public MemoDataAccessorException() { }

        /// <summary>
        /// Constructor with an error message to throw with it.
        /// </summary>
        /// <param name="message">Error message</param>
        public MemoDataAccessorException(string message) : base(message) { }

        /// <summary>
        /// Constructor with an error message and a reference to an inner exception, that is the cause of this exception.
        /// </summary>
        /// <param name="message"> IDE IS ÍRJ!</param>
        /// <param name="innerException">DE EZ IS KIMARADT!</param>
        public MemoDataAccessorException(string message, Exception innerException) : base(message, innerException) { }

        /// <summary>
        /// Constructor with serialized data.
        /// </summary>
        /// <param name="info">IDE SE ÍRTÁL!</param>
        /// <param name="context">MEG IDE SE W@ZZE!</param>
        protected MemoDataAccessorException(SerializationInfo info, StreamingContext context) : base(info, context) { }
    }
}
